package com.ncs.base.common.rule;
/*
 * package com.ncs.base.task.config;
 * 
 * import java.util.Properties;
 * 
 * import javax.mail.MessagingException; import javax.mail.internet.MimeMessage;
 * 
 * import org.slf4j.LoggerFactory; import
 * org.springframework.beans.factory.annotation.Value; import
 * org.springframework.mail.javamail.JavaMailSenderImpl; import
 * org.springframework.mail.javamail.MimeMessageHelper; import
 * org.springframework.stereotype.Component;
 * 
 * import ch.qos.logback.classic.Logger;
 * 
 * @Component public class MailSenderFacade {
 * 
 * 
 * private final Logger logger = (Logger)
 * LoggerFactory.getLogger(MailSenderFacade.class);
 * 
 * public void sendMailHtml(final String toEmail,final String subject,final
 * String text,String host,String username,String password){ try{
 * 
 * JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
 * //javaMailSender.setUsername("1362114346@qq.com");
 * javaMailSender.setUsername(username); javaMailSender.setPassword(password);
 * javaMailSender.setHost(host);
 * javaMailSender.setUsername("itsystem@qiaohu.com");
 * javaMailSender.setPassword("BlsIT#2@17ML01");
 * javaMailSender.setHost("smtp.qiaohu.com"); javaMailSender.setPort(25);
 * javaMailSender.setProtocol("smtp");
 * javaMailSender.setDefaultEncoding("UTF-8"); Properties mailProperties = new
 * Properties(); mailProperties.put("mail.smtp.auth", true);
 * mailProperties.put("mail.smtp.starttls.enable", true);
 * javaMailSender.setJavaMailProperties(mailProperties); MimeMessage mimeMessage
 * = getMimeMessage(toEmail,subject,text, javaMailSender,username);
 * javaMailSender.send(mimeMessage);
 * 
 * logger.info("发往 "+toEmail+" 邮件发送成功"); } catch (MessagingException e) {
 * logger.error("发往 "+toEmail+" 邮件发送异常", e); } }
 * 
 * 
 * 
 * 
 * private MimeMessage getMimeMessage(String toEmail,String subject,String text,
 * JavaMailSenderImpl javaMailSender,String username) throws MessagingException
 * { MimeMessage mimeMessage = javaMailSender.createMimeMessage();
 * MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage,
 * true, "UTF-8"); mimeMessageHelper.setFrom(username);
 * mimeMessageHelper.setTo(toEmail); mimeMessageHelper.setSubject(subject);
 * mimeMessageHelper.setText(text, true); return mimeMessage; }
 * 
 * 
 * public static void main(String[] args) { MailSenderFacade mailSenderFacade =
 * new MailSenderFacade(); //mailSenderFacade.sendMailHtml("1362114346@qq.com",
 * "来自邮箱测试接口邮件", "来自邮箱测试接口邮件");
 * 
 * } }
 */